package br.com.imob.modelo;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Gilton Nascimento
 */
@Entity
@Table(name = "\"SITUACAO\"", catalog = "imob", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Situacao.findAll", query = "SELECT s FROM Situacao s"),
    @NamedQuery(name = "Situacao.findBySituacaoId", query = "SELECT s FROM Situacao s WHERE s.situacaoId = :situacaoId"),
    @NamedQuery(name = "Situacao.findBySituacao", query = "SELECT s FROM Situacao s WHERE s.situacao = :situacao"),
    @NamedQuery(name = "Situacao.findLikeBySituacao", query = "SELECT s FROM Situacao s WHERE s.situacao Like :situacao"),
    @NamedQuery(name = "Situacao.findBySituacaoDesc", query = "SELECT s FROM Situacao s WHERE s.situacaoDesc = :situacaoDesc"),
    @NamedQuery(name = "Situacao.findLikeBySituacaoDesc", query = "SELECT s FROM Situacao s WHERE s.situacaoDesc Like :situacaoDesc")
    })
public class Situacao implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
//  <editor-fold defaultstate="collapsed" desc="Geradores de Sequencias">
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_STORE")
    @SequenceGenerator(name = "SEQ_STORE", sequenceName = "next_situacao")// </editor-fold>
    @Basic(optional = false)
    @Column(name = "situacao_id", nullable = false)
    private Integer situacaoId;
    @Column(name = "situacao", length = 50)
    private String situacao;
    @Column(name = "situacao_desc", length = 2147483647)
    private String situacaoDesc;

    public Situacao() { }

    public Situacao(Integer situacaoId) {
        this.situacaoId = situacaoId;
    }

    public Situacao(String status) {
		situacao = status;
	}

    public Situacao(int id, String status) {
    	situacaoId = id;
    	situacao = status;
    }
    
	public Situacao(int id, String status, String desc) {
		this(id,status);
		situacaoDesc = desc;
	}


	public Integer getSituacaoId() {
        return situacaoId;
    }

    public void setSituacaoId(Integer situacaoId) {
        this.situacaoId = situacaoId;
    }

    public String getSituacao() {
        return situacao;
    }

    public void setSituacao(String situacao) {
    	new Situacao();
        this.situacao = situacao;
    }

    public String getSituacaoDesc() {
        return situacaoDesc;
    }

    public void setSituacaoDesc(String situacaoDesc) {
        this.situacaoDesc = situacaoDesc;
    }


    public Object[] getValues() {
    	Object[] objects = { situacaoId, situacao, situacaoDesc };
    	return objects; 
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (situacaoId != null ? situacaoId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Situacao)) {
            return false;
        }
        Situacao other = (Situacao) object;
        if ((this.situacaoId == null && other.situacaoId != null) || (this.situacaoId != null && !this.situacaoId.equals(other.situacaoId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.imob.modelo.Situacao[situacaoId=" + situacaoId + "]";
    }

}